<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head>
  <body>
  <g:if test="${upd=='si'}">
    <script>
      goTo('usuario','list','','definicion_list');
    </script>
  </g:if>
  <g:if test="${sendingEmail==1}">
    <script>
      closeLoading('loader')
    </script>
  </g:if>
  <div class="definicion">
    <div class="seccion">
${DefinicionUtils.buildHeaderShow('','usuario')}
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <g:if test="${listaErrores && listaErrores.size()>0}">
        <div class="errors">
          <ul>
            <g:each var="error" in="${listaErrores}">
              <li>${error}</li>
            </g:each>
          </ul></div>
      </g:if>
      <g:hasErrors bean="${usuarioInstance}">
        <div class="errors">
          <g:renderErrors bean="${usuarioInstance}" as="list" />
        </div>
      </g:hasErrors>
    </div>
    <g:form action="save" method="post" autocomplete="off" name="definicion">
      <input type="hidden" name="eOc" value="${eOc}"/>
      <table border="0" align="center">
        <tr>
          <td>
            <table align="center">

              <tr>
                <td class="labels">Nombre Completo</td>
                <td class="value ${hasErrors(bean:usuarioInstance,field:'nombreCompleto','errors')}">
                  <input style="width:200px" type="text"  class=":required :alpha" id="nombreCompleto" name="nombreCompleto" value="${fieldValue(bean:usuarioInstance,field:'nombreCompleto')}" onKeyPress="return acceptInput(event,2,this,false)"/>                </td>
              </tr>
              <tr>
                <td class="labels">Tel&eacute;fono</td>
                <td class="value ${hasErrors(bean:usuarioInstance,field:'telefono','errors')}">
                  <input style="width:200px" type="text" class=":required" id="telefono" name="telefono" value="${fieldValue(bean:usuarioInstance,field:'telefono')}" onKeyPress="return acceptInput(event,3,this,false)"/>                </td>
              </tr>
              <tr>
                <td class="labels">Correo Electr&oacute;nico</td>
                <td valign="top" class="value ${hasErrors(bean:usuarioInstance,field:'email','errors')}">
                  <input  style="width:200px" type="text"  class=":required :email" id="email" name="email"  value="${usuarioInstance.email}"/>                </td>
              </tr>
              <tr>
                <td class="labels">Estado</td>
                <td valign="top" class="value ${hasErrors(bean:usuarioInstance,field:'estado','errors')}">
              <g:select  style="width:200px" optionKey="id" optionValue="nombre" from="${estadosUsuario}" name="estado" value="${usuarioInstance?.estado}"  class="campos"></g:select></td>
        </tr>
        <tr>
          <td class="labels">Perfil</td>
          <td class="value ${hasErrors(bean:usuarioInstance,field:'perfil','errors')}">
        <g:select style="width:200px"  optionKey="id" from="${sucre.Perfil.list()}" name="perfil.id" value="${usuarioInstance?.perfil?.id}" class="campos" ></g:select></td>
        </tr>
        <tr>
          <td class="labels">Usuario</td>
          <td class="value ${hasErrors(bean:usuarioInstance,field:'login','errors')}">
            <input style="width:200px" type="text" class=":required" id="login" name="login" value="${fieldValue(bean:usuarioInstance,field:'login')}" ${eOc=='edit'?'disabled':''}/>                </td>
        </tr>


        <tr>
          <td height="6"></td>
        </tr>
        <tr>
          <td>Clave</td>  
          <td width="20%">
            <div id="generatePassword">
              <input type="password" name="default_password" value="${defaulPassword}" style="width:200px" class="campos" disabled /><span class="help_button" title="Establece la contraseña por defecto">&nbsp;</span>


            </div> </td>
          <td width="10%"><input type="button" class="boton" value="Generar" style="width:80px" onClick="return goTo('usuario','generarPassword','','generatePassword')" />                                 </td>



        </tr>
      </table>
      </td>
      </tr>
      </table>

      <br/>
      <input type="text" id="id" name="id" style="display: none;" value="${usuarioInstance.id}" disabled class="disabled"/>
    </g:form>
	
  </div>
</body>
</html>